#ifndef ROOM_H
#define ROOM_H

#include <QObject>
#include "socket.h"

/*
 * @brief:直播间类:负责创建房间
 * @brief:参数有：房间号，房间主人，观众列表
 * @brief:方法有：增加观众，踢出观众，聊天
 */
class Room : public QObject
{
    Q_OBJECT

    QString roomID;
    QString roomHost;
    QList<Socket*> Audience;
    QStringList AudienceNames;

public:
    ~Room();
    explicit Room(QObject *parent = nullptr);
    Room(QString& id, QString& host,Socket *anchor);

    void addAudience(Socket* audience);
    void deleAudience(Socket* audience);
    void chatBroadcast(QByteArray* data);
    void offBroadcast(QByteArray* data);
    void addAudiBroadcast(QByteArray* data);
    void audioBroadcast(const QByteArray &data);
    void videoBroadcast(Socket* socket,const QByteArray &data);

    QString& getRoomID() {return roomID;}
    QString& getRoomHost() {return roomHost;}
    QStringList& getAudienceNames() {return AudienceNames;}

signals:

public slots:
};

#endif // ROOM_H
